package com.jhhc.RHDB.Data.Pojo;


import com.alibaba.fastjson2.annotation.JSONField;

import java.text.ParseException;
import java.text.SimpleDateFormat;

public class ST_TIDE_R {
    private String stcd;

    private String stcd1;

    private String tm;

    private Double tdz;

    private Double airp;

    private String tdchrcd;

    private Integer tdptn;

    private Integer hltdmk;

    public String getStcd() {
        return stcd;
    }

    public void setStcd(String stcd) {
        this.stcd = stcd == null ? null : stcd.trim();
    }

    public String getTm() {
        return tm.substring(0,19);
    }

    public void setTm(String tm) {
        this.tm = tm;
    }

    public Double getTdz() {
        return tdz;
    }

    public void setTdz(Double tdz) {
        this.tdz = tdz;
    }

    public Double getAirp() {
        return airp;
    }

    public void setAirp(Double airp) {
        this.airp = airp;
    }

    public String getTdchrcd() {
        return tdchrcd;
    }

    public void setTdchrcd(String tdchrcd) {
        this.tdchrcd = tdchrcd == null ? null : tdchrcd.trim();
    }

    public Integer getTdptn() {
        return tdptn;
    }

    public void setTdptn(Integer tdptn) {
        this.tdptn = tdptn;
    }

    public Integer getHltdmk() {
        return hltdmk;
    }

    public void setHltdmk(Integer hltdmk) {
        this.hltdmk = hltdmk;
    }

    @Override
    public String toString() {
        return "ST_TIDE_R{" +
                "stcd='" + stcd + '\'' +
                ", tm='" + tm + '\'' +
                ", tdz=" + tdz +
                ", airp=" + airp +
                ", tdchrcd='" + tdchrcd + '\'' +
                ", tdptn=" + tdptn +
                ", hltdmk=" + hltdmk +
                '}';
    }



    //设置分组
    public String getMonth() {
        return setMonth();
    }
    public String setMonth() {
        String month1 =  getTm();
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); // 日期格式转换 月份
        try {
            return format.format(format.parse(month1)).substring(8,10);
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return null;
    }

    public String getMonth2() {
        return setMonth2();
    }
    public String setMonth2() {
        String month1 =  getTm();
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); // 日期格式转换 月份
        try {

            return  format.format(format.parse(month1)).substring(11,16);

        } catch (ParseException e) {
            e.printStackTrace();
        }
        return null;
    }


    //根据天分组
    public String getDay() {
        return setDay();
    }
    public String setDay() {
        String month1 = getTm();
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); // 日期格式转换 月份
        try {

            return  format.format(format.parse(month1)).substring(0,10);

        } catch (ParseException e) {
            e.printStackTrace();
        }
        return null;
    }
    @JSONField(serialize = false)
    public String getHour() {
        return setHour();
    }
    @JSONField(serialize = false)
    public String setHour() {
        String month1 = getTm();
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); // 日期格式转换 月份
        try {

            return  format.format(format.parse(month1)).substring(11,13);

        } catch (ParseException e) {
            e.printStackTrace();
        }
        return null;
    }
    //根据min
    public String getMin() {
        return setMin();
    }
    public String setMin() {
        String month1 = getTm();
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); // 日期格式转换 月份
        try {

            return  format.format(format.parse(month1)).substring(14,16);

        } catch (ParseException e) {
            e.printStackTrace();
        }
        return null;
    }

}